 //封装JSON.parse
 let javaData = '{"uname":"源于周","price":"18"}'
 function parse(javaData){
     let webObj = {}
     javaData = javaData.replace(/{|}|"|\s/g,'')
     console.log(javaData);
     let javaDataArr = javaData.split(',')
     javaDataArr.forEach(item=>{
         let keyvalArr = item.split(':')
         let key = keyvalArr[0]
         let val = keyvalArr[1]  
         webObj[key] = val;
     })
     console.log(webObj);
     return webObj
 }
 var s = parse(javaData)


  //封装JSON.stringify
  let webObj = {a:1,b:2,c:"漂亮"}
  function stringify(webObj){
      let arr = []
      for(let key in webObj){
          let temp = `"${key}":"${webObj[key]}"`
          arr.push(temp)
      }
      console.log(arr);
      console.log(`{${arr.join(',')}}`); 
      return `{${arr.join(',')}}`
  }
  var s=stringify(webObj)